home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / DShowIDL / control.odl < prev    next >
Text File  |  2001-10-08  |  30KB  |  910 lines

  1. //------------------------------------------------------------------------------
  2. // File: Control.odl
  3. //
  4. // Desc: 
  5. //
  6. // Copyright (c) 1999-2001, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9. // Neutral/English language type library for basic Quartz control interfaces
  10.  
  11. // the quartz type library defines the basic control interfaces
  12. [
  13.     uuid(56a868b0-0ad4-11ce-b03a-0020af0ba770),
  14.     helpstring("ActiveMovie control type library"),
  15.     lcid(0x0000),
  16.     version(1.0)
  17. ]
  18. library QuartzTypeLib
  19. {
  20.     importlib("STDOLE32.TLB");
  21.  
  22.     // types are restricted to be automation-compatible
  23.     typedef double REFTIME;             // ReferenceTime
  24.     typedef LONG_PTR OAEVENT;         // should be a HANDLE
  25.     typedef LONG_PTR OAHWND;          // should be an hwnd
  26.  
  27.     // from strmif.idl
  28.     typedef long OAFilterState;
  29.  
  30.     // collection interface - represents a collection of IUnknowns
  31.     // this is used below to collect filter-info objects, registry-filters
  32.     // pin-info objects and wrapped media type objects
  33.     [
  34.         uuid(56a868b9-0ad4-11ce-b03a-0020af0ba770),
  35.         helpstring("Collection"),
  36.         odl,
  37.         oleautomation,
  38.         dual
  39.     ]
  40.     interface IAMCollection : IDispatch
  41.     {
  42.         // number of items in collection
  43.         [propget]
  44.         HRESULT Count(
  45.                     [out, retval] LONG* plCount);
  46.  
  47.         // return IUnknown for contained item by index
  48.         HRESULT Item(
  49.                     [in]  long lItem,
  50.                     [out] IUnknown** ppUnk);
  51.  
  52.         // return IUnknown for an object that implements IEnumVARIANT on
  53.         // this collection
  54.         [propget]
  55.         HRESULT _NewEnum(
  56.                     [out, retval] IUnknown** ppUnk);
  57.     }
  58.  
  59.  
  60.     // core control providing state control
  61.     [
  62.         uuid(56a868b1-0ad4-11ce-b03a-0020af0ba770),
  63.         helpstring("IMediaControl interface"),
  64.         odl,
  65.         oleautomation,
  66.         dual
  67.     ]
  68.     interface IMediaControl : IDispatch
  69.     {
  70.         // methods
  71.         HRESULT Run();
  72.         HRESULT Pause();
  73.         HRESULT Stop();
  74.  
  75.         //returns the state. same semantics as IMediaFilter::GetState
  76.  
  77.         HRESULT GetState(
  78.                     [in] LONG msTimeout,
  79.                     [out] OAFilterState* pfs);
  80.  
  81.         // adds and connects filters needed to play the specified file
  82.         // (same as IFilterGraph::RenderFile)
  83.         HRESULT RenderFile(
  84.                     [in] BSTR strFilename);
  85.  
  86.         // adds to the graph the source filter that can read this file,
  87.         // and returns an IFilterInfo object for it (actually returns
  88.         // an IDispatch for the IFilterInfo object).
  89.         HRESULT AddSourceFilter(
  90.                     [in] BSTR strFilename,
  91.                     [out] IDispatch**ppUnk);
  92.  
  93.         // get a collection of IFilterInfo objects representing the
  94.         // filters in the graph (returns IDispatch for an object
  95.         // that supports IAMCollection
  96.         [propget]
  97.         HRESULT FilterCollection(
  98.                         [out, retval] IDispatch** ppUnk);
  99.  
  100.         // get a collection of IRegFilter objects representing the
  101.         // filters available in the registry
  102.         [propget]
  103.         HRESULT RegFilterCollection(
  104.                         [out, retval] IDispatch** ppUnk);
  105.  
  106.         HRESULT StopWhenReady();
  107.     }
  108.  
  109.  
  110.     // provides an event notification scheme passing events
  111.     // asynchronously to applications. See also IMediaEventSink in
  112.     // strmif.idl and sdk\h\evcodes.h.
  113.     //
  114.     // this interface behaves as if events are held on a queue. A call to
  115.     // IMediaEventSink::Notify will place an event on this queue. Calling
  116.     // GetEvent removes the first item off the queue and returns it. Items are
  117.     // returned in the order they were queued (there is no priority scheme).
  118.     // The event handle is in a signalled state iff the queue is non-empty.
  119.     //
  120.     // Apps that issue multiple Run calls without always picking up the
  121.     // completion events are advised to call GetEvent or WaitForCompletion
  122.     // (with a 0 timeout) repeatedly to remove all events from the queue
  123.     // when in stopped or paused state before each Run method.
  124.     //
  125.     // Parameters to events are actually LONG, IUnknown* or BSTR. You need to
  126.     // look at evcode.h for details of parameters to a specific event code.
  127.     // In order to correctly free resources, always call FreeEventParams
  128.     // after receiving an event.
  129.     //
  130.  
  131.     [
  132.         uuid(56a868b6-0ad4-11ce-b03a-0020af0ba770),
  133.         helpstring("IMediaEvent interface"),
  134.         odl,
  135.         oleautomation,
  136.         dual
  137.     ]
  138.     interface IMediaEvent : IDispatch
  139.     {
  140.         // get back the event handle. This is manual-reset
  141.         // (don't - it's reset by the event mechanism) and remains set
  142.         // when events are queued, and reset when the queue is empty.
  143.         HRESULT GetEventHandle(
  144.                         [out] OAEVENT * hEvent);
  145.  
  146.         // remove the next event notification from the head of the queue and
  147.         // return it. Waits up to msTimeout millisecs if there are no events.
  148.         // if a timeout occurs without any events, this method will return
  149.         // E_ABORT, and the value of the event code and other parameters
  150.         // is undefined.
  151.         //
  152.         // If this call returns successfully the caller MUST call
  153.         // FreeEventParams(lEventCode, lParam1, lParam2) to release
  154.         // resources held inside the event arguments
  155.         //
  156.         HRESULT GetEvent(
  157.                         [out] long * lEventCode,
  158.                         [out] LONG_PTR * lParam1,
  159.                         [out] LONG_PTR * lParam2,
  160.                         [in] long msTimeout
  161.                         );
  162.  
  163.         // Calls GetEvent repeatedly discarding events until it finds a
  164.         // completion event (EC_COMPLETE, EC_ERRORABORT, or EC_USERABORT).
  165.         // The completion event is removed from the queue and returned
  166.         // in pEvCode. Note that the object is still in running mode until
  167.         // a Pause or Stop call is made.
  168.         // If the timeout occurs, *pEvCode will be 0 and E_ABORT will be
  169.         // returned.
  170.         HRESULT WaitForCompletion(
  171.                         [in] long msTimeout,
  172.                         [out] long * pEvCode);
  173.  
  174.         // cancels any system handling of the specified event code
  175.         // and ensures that the events are passed straight to the application
  176.         // (via GetEvent) and not handled. A good example of this is
  177.         // EC_REPAINT: default handling for this ensures the painting of the
  178.         // window and does not get posted to the app.
  179.         HRESULT CancelDefaultHandling(
  180.                         [in] long lEvCode);
  181.  
  182.         // restore the normal system default handling that may have been
  183.         // cancelled by CancelDefaultHandling().
  184.         HRESULT RestoreDefaultHandling( [in] long lEvCode);
  185.  
  186.         // Free any resources associated with the parameters to an event.
  187.         // Event parameters may be LONGs, IUnknown* or BSTR. No action
  188.         // is taken with LONGs. IUnknown are passed addrefed and need a
  189.         // Release call. BSTR are allocated by the task allocator and will be
  190.         // freed by calling the task allocator.
  191.         HRESULT FreeEventParams(
  192.                 [in] long lEvCode,
  193.                         [in] LONG_PTR lParam1,
  194.                         [in] LONG_PTR lParam2
  195.                         );
  196.     }
  197.  
  198.     [
  199.         uuid(56a868c0-0ad4-11ce-b03a-0020af0ba770),
  200.         helpstring("IMediaEventEx interface"),
  201.         odl
  202.     ]
  203.     interface IMediaEventEx : IMediaEvent
  204.     {
  205.  
  206.         // Register a window to send messages to when events occur
  207.         // Parameters:
  208.         //
  209.         //    hwnd - handle of window to notify -
  210.         //           pass NULL to stop notification
  211.         //    lMsg - Message id to pass messages with
  212.         //    lInstanceData - will come back in lParam
  213.         //
  214.         // The event information must still be retrived by a call
  215.         // to GetEvent when the window message is received.
  216.         //
  217.         // Multiple events may be notified with one window message.
  218.         //
  219.         HRESULT SetNotifyWindow(
  220.                         [in] OAHWND hwnd,
  221.                         [in] long lMsg,
  222.             [in] LONG_PTR lInstanceData
  223.                         );
  224.  
  225.         // Turn events notification on or off
  226.         // lNoNotify = 0x00 event notification is ON
  227.         // lNoNotify = 0x01 event notification is OFF.  The
  228.         // handle returned by GetEventHandle will be signalled at
  229.         // end of stream
  230.         HRESULT SetNotifyFlags(
  231.                         [in] long lNoNotifyFlags
  232.                          );
  233.         HRESULT GetNotifyFlags(
  234.                         [out] long *lplNoNotifyFlags
  235.                          );
  236.     }
  237.  
  238.  
  239.  
  240.  
  241.     // seek/cueing for positional media
  242.     [
  243.         uuid(56a868b2-0ad4-11ce-b03a-0020af0ba770),
  244.         helpstring("IMediaPosition interface"),
  245.         odl,
  246.         oleautomation,
  247.         dual
  248.     ]
  249.     interface IMediaPosition : IDispatch
  250.     {
  251.         // properties
  252.  
  253.         [propget]
  254.         HRESULT Duration(
  255.                     [out, retval] REFTIME* plength);
  256.  
  257.         [propput]
  258.         HRESULT CurrentPosition(
  259.                     [in] REFTIME llTime);
  260.  
  261.         [propget]
  262.         HRESULT CurrentPosition(
  263.                     [out, retval] REFTIME* pllTime);
  264.  
  265.         [propget]
  266.         HRESULT StopTime(
  267.                     [out, retval] REFTIME* pllTime);
  268.         [propput]
  269.         HRESULT StopTime(
  270.                     [in] REFTIME llTime);
  271.  
  272.         [propget]
  273.         HRESULT PrerollTime(
  274.                     [out, retval] REFTIME* pllTime);
  275.         [propput]
  276.         HRESULT PrerollTime(
  277.                     [in] REFTIME llTime);
  278.  
  279.         [propput]
  280.         HRESULT Rate(
  281.                     [in] double dRate);
  282.         [propget]
  283.         HRESULT Rate(
  284.                     [out, retval] double * pdRate);
  285.  
  286.         HRESULT CanSeekForward([out, retval] LONG *pCanSeekForward);
  287.         HRESULT CanSeekBackward([out, retval] LONG *pCanSeekBackward);
  288.     }
  289.  
  290.     // basic audio-related functionality
  291.     [
  292.         uuid(56a868b3-0ad4-11ce-b03a-0020af0ba770),
  293.         helpstring("IBasicAudio interface"),
  294.         odl,
  295.         oleautomation,
  296.         dual
  297.     ]
  298.     interface IBasicAudio : IDispatch
  299.     {
  300.         // properties
  301.  
  302.         [propput]
  303.         HRESULT Volume(
  304.                     [in] long lVolume);
  305.         [propget]
  306.         HRESULT Volume(
  307.                     [out, retval] long * plVolume);
  308.  
  309.         [propput]
  310.         HRESULT Balance(
  311.                     [in] long lBalance);
  312.         [propget]
  313.         HRESULT Balance(
  314.                     [out, retval] long * plBalance);
  315.     }
  316.  
  317.     // basic window-related functionality
  318.     [
  319.         uuid(56a868b4-0ad4-11ce-b03a-0020af0ba770),
  320.         helpstring("IVideoWindow interface"),
  321.         odl,
  322.         oleautomation,
  323.         dual
  324.     ]
  325.     interface IVideoWindow : IDispatch
  326.     {
  327.         // properties
  328.  
  329.         // set and get the window title caption
  330.  
  331.         [propput]
  332.         HRESULT Caption([in] BSTR strCaption);
  333.         [propget]
  334.         HRESULT Caption([out, retval] BSTR *strCaption);
  335.  
  336.         // change the window styles (as per Win32)
  337.  
  338.         [propput]
  339.         HRESULT WindowStyle([in] long WindowStyle);
  340.         [propget]
  341.         HRESULT WindowStyle([out, retval] long *WindowStyle);
  342.  
  343.         // change the extended window styles (as per Win32)
  344.  
  345.         [propput]
  346.         HRESULT WindowStyleEx([in] long WindowStyleEx);
  347.         [propget]
  348.         HRESULT WindowStyleEx([out, retval] long *WindowStyleEx);
  349.  
  350.         [propput]
  351.         HRESULT AutoShow([in] long AutoShow);
  352.         [propget]
  353.         HRESULT AutoShow([out, retval] long *AutoShow);
  354.  
  355.         // change the window state (as per Win32)
  356.  
  357.         [propput]
  358.         HRESULT WindowState([in] long WindowState);
  359.         [propget]
  360.         HRESULT WindowState([out, retval] long *WindowState);
  361.  
  362.         // realise the palette in the background
  363.  
  364.         [propput]
  365.         HRESULT BackgroundPalette([in] long BackgroundPalette);
  366.         [propget]
  367.         HRESULT BackgroundPalette([out, retval] long *pBackgroundPalette);
  368.  
  369.         // affect the visibility of the window
  370.  
  371.         [propput]
  372.         HRESULT Visible([in] long Visible);
  373.         [propget]
  374.         HRESULT Visible([out, retval] long *pVisible);
  375.  
  376.         // change the desktop position of the video window
  377.  
  378.         [propput]
  379.         HRESULT Left([in] long Left);
  380.         [propget]
  381.         HRESULT Left([out, retval] long *pLeft);
  382.  
  383.         [propput]
  384.         HRESULT Width([in] long Width);
  385.         [propget]
  386.         HRESULT Width([out, retval] long *pWidth);
  387.  
  388.         [propput]
  389.         HRESULT Top([in] long Top);
  390.         [propget]
  391.         HRESULT Top([out, retval] long *pTop);
  392.  
  393.         [propput]
  394.         HRESULT Height([in] long Height);
  395.         [propget]
  396.         HRESULT Height([out, retval] long *pHeight);
  397.  
  398.         // change the owning window of the video
  399.  
  400.         [propput]
  401.         HRESULT Owner([in] OAHWND Owner);
  402.         [propget]
  403.         HRESULT Owner([out, retval] OAHWND *Owner);
  404.  
  405.         // change the window to receive posted messages
  406.  
  407.         [propput]
  408.         HRESULT MessageDrain([in] OAHWND Drain);
  409.         [propget]
  410.         HRESULT MessageDrain([out, retval] OAHWND *Drain);
  411.  
  412.         [propget]
  413.         HRESULT BorderColor([out, retval] long *Color);
  414.  
  415.         [propput]
  416.         HRESULT BorderColor([in] long Color);
  417.  
  418.         [propget]
  419.         HRESULT FullScreenMode([out, retval] long *FullScreenMode);
  420.  
  421.         [propput]
  422.         HRESULT FullScreenMode([in] long FullScreenMode);
  423.  
  424.         // methods
  425.  
  426.         // ask the renderer to grab it's window the foreground
  427.         // and optionally also give the window the input focus
  428.         HRESULT SetWindowForeground([in] long Focus);
  429.  
  430.         // owners should pass WM_PALETTECHANGED and WM_SYSCOLORCHANGE
  431.         // messages on the filter graph so they can be distributed
  432.         // otherwise child renderers never see these messages go by
  433.  
  434.         HRESULT NotifyOwnerMessage([in] OAHWND hwnd,
  435.                                    [in] long uMsg,
  436.                                    [in] LONG_PTR wParam,
  437.                                    [in] LONG_PTR lParam
  438.                                    );
  439.  
  440.         // get and set the window position on the desktop
  441.  
  442.         HRESULT SetWindowPosition([in] long Left,
  443.                                   [in] long Top,
  444.                                   [in] long Width,
  445.                                   [in] long Height);
  446.  
  447.         HRESULT GetWindowPosition([out] long *pLeft,
  448.                                   [out] long *pTop,
  449.                                   [out] long *pWidth,
  450.                                   [out] long *pHeight);
  451.  
  452.         // get the ideal sizes for the video image playback (client) area
  453.  
  454.         HRESULT GetMinIdealImageSize([out] long *pWidth,[out] long *pHeight);
  455.         HRESULT GetMaxIdealImageSize([out] long *pWidth,[out] long *pHeight);
  456.  
  457.         // get the restored window size when we're maximised or iconic
  458.  
  459.         HRESULT GetRestorePosition([out] long *pLeft,
  460.                                    [out] long *pTop,
  461.                                    [out] long *pWidth,
  462.                                    [out] long *pHeight);
  463.  
  464.     // show and hide cursors useful when fullscreen
  465.     HRESULT HideCursor([in] long HideCursor);
  466.         HRESULT IsCursorHidden([out] long *CursorHidden);
  467.     }
  468.  
  469.     // basic video-related functionality
  470.     [
  471.         uuid(56a868b5-0ad4-11ce-b03a-0020af0ba770),
  472.         helpstring("IBasicVideo interface"),
  473.         odl,
  474.         oleautomation,
  475.         dual
  476.     ]
  477.     interface IBasicVideo : IDispatch
  478.     {
  479.         // properties
  480.  
  481.         // Video specific (approximate) bit and frame rates
  482.  
  483.         [propget]
  484.         HRESULT AvgTimePerFrame([out, retval] REFTIME *pAvgTimePerFrame);
  485.  
  486.         [propget]
  487.         HRESULT BitRate([out, retval] long *pBitRate);
  488.  
  489.         [propget]
  490.         HRESULT BitErrorRate([out, retval] long *pBitErrorRate);
  491.  
  492.         // read the native video size
  493.  
  494.         [propget]
  495.         HRESULT VideoWidth([out, retval] long *pVideoWidth);
  496.  
  497.         [propget]
  498.         HRESULT VideoHeight([out, retval] long *pVideoHeight);
  499.  
  500.         // change the source rectangle for the video
  501.  
  502.         [propput]
  503.         HRESULT SourceLeft([in] long SourceLeft);
  504.         [propget]
  505.         HRESULT SourceLeft([out, retval] long *pSourceLeft);
  506.  
  507.         [propput]
  508.         HRESULT SourceWidth([in] long SourceWidth);
  509.         [propget]
  510.         HRESULT SourceWidth([out, retval] long *pSourceWidth);
  511.  
  512.         [propput]
  513.         HRESULT SourceTop([in] long SourceTop);
  514.         [propget]
  515.         HRESULT SourceTop([out, retval] long *pSourceTop);
  516.  
  517.         [propput]
  518.         HRESULT SourceHeight([in] long SourceHeight);
  519.         [propget]
  520.         HRESULT SourceHeight([out, retval] long *pSourceHeight);
  521.  
  522.         // change the destination rectangle for the video
  523.  
  524.         [propput]
  525.         HRESULT DestinationLeft([in] long DestinationLeft);
  526.         [propget]
  527.         HRESULT DestinationLeft([out, retval] long *pDestinationLeft);
  528.  
  529.         [propput]
  530.         HRESULT DestinationWidth([in] long DestinationWidth);
  531.         [propget]
  532.         HRESULT DestinationWidth([out, retval] long *pDestinationWidth);
  533.  
  534.         [propput]
  535.         HRESULT DestinationTop([in] long DestinationTop);
  536.         [propget]
  537.         HRESULT DestinationTop([out, retval] long *pDestinationTop);
  538.  
  539.         [propput]
  540.         HRESULT DestinationHeight([in] long DestinationHeight);
  541.         [propget]
  542.         HRESULT DestinationHeight([out, retval] long *pDestinationHeight);
  543.  
  544.         // methods
  545.  
  546.         // get and set the source rectangle position
  547.  
  548.         HRESULT SetSourcePosition([in] long Left,
  549.                                   [in] long Top,
  550.                                   [in] long Width,
  551.                                   [in] long Height);
  552.  
  553.         HRESULT GetSourcePosition([out] long *pLeft,
  554.                                   [out] long *pTop,
  555.                                   [out] long *pWidth,
  556.                                   [out] long *pHeight);
  557.  
  558.         HRESULT SetDefaultSourcePosition();
  559.  
  560.         // get and set the destination rectangle position
  561.  
  562.         HRESULT SetDestinationPosition([in] long Left,
  563.                                        [in] long Top,
  564.                                        [in] long Width,
  565.                                        [in] long Height);
  566.  
  567.         HRESULT GetDestinationPosition([out] long *pLeft,
  568.                                        [out] long *pTop,
  569.                                        [out] long *pWidth,
  570.                                        [out] long *pHeight);
  571.  
  572.         HRESULT SetDefaultDestinationPosition();
  573.  
  574.         // get the native video dimensions
  575.  
  576.         HRESULT GetVideoSize([out] long *pWidth,[out] long *pHeight);
  577.  
  578.         // get all or some of the current video palette
  579.  
  580.         HRESULT GetVideoPaletteEntries([in] long StartIndex,
  581.                                        [in] long Entries,
  582.                                        [out] long *pRetrieved,
  583.                                        [out] long *pPalette);
  584.  
  585.         HRESULT GetCurrentImage([in,out] long *pBufferSize,
  586.                                 [out] long *pDIBImage);
  587.  
  588.         // are we using a default source or destination
  589.  
  590.         HRESULT IsUsingDefaultSource();
  591.         HRESULT IsUsingDefaultDestination();
  592.     }
  593.  
  594.     // interface extension to IBasicVideo to return preferred aspect ratio
  595.     [
  596.         uuid(329bb360-f6ea-11d1-9038-00a0c9697298),
  597.         helpstring("IBasicVideo2"),
  598.         odl
  599.     ]
  600.     interface IBasicVideo2 : IBasicVideo
  601.     {
  602.         //  This may not match the native video dimensions because of
  603.         //  non-square pixels or whatever.
  604.         //  The video may not always be displayed in the preferred
  605.         //  aspect ratio for performance reasons
  606.  
  607.         HRESULT GetPreferredAspectRatio([out] long *plAspectX,
  608.                                         [out] long *plAspectY);
  609.     }
  610.  
  611.     // interface returned to a command that has been queued via IQueueCommand
  612.     [
  613.         uuid(56a868b8-0ad4-11ce-b03a-0020af0ba770),
  614.         helpstring("IDeferredCommand"),
  615.         odl
  616.     ]
  617.     interface IDeferredCommand : IUnknown
  618.     {
  619.         HRESULT Cancel();
  620.         HRESULT Confidence(
  621.                     [out] LONG* pConfidence);
  622.         HRESULT Postpone(
  623.                     [in] REFTIME newtime);
  624.         // return value is S_OK if completed. phrResult is set to the
  625.         // result of the deferred command.
  626.         HRESULT GetHResult(
  627.                     [out] HRESULT* phrResult);
  628.     };
  629.  
  630.     // queue an IDispatch-based command for execution at a specified time
  631.     [
  632.         uuid(56a868b7-0ad4-11ce-b03a-0020af0ba770),
  633.         helpstring("IQueueCommand"),
  634.         odl
  635.     ]
  636.     interface IQueueCommand  : IUnknown
  637.     {
  638.         HRESULT InvokeAtStreamTime(
  639.                     [out] IDeferredCommand** pCmd,
  640.                     [in] REFTIME time,            // at this streamtime
  641.                     [in] GUID* iid,                   // call this interface
  642.                     [in] long dispidMethod,         // ..and this method
  643.                     [in] short wFlags,              // method/property
  644.                     [in] long cArgs,                // count of args
  645.                     [in] VARIANT* pDispParams,      // actual args
  646.                     [in, out] VARIANT* pvarResult,  // return value
  647.                     [out] short* puArgErr           // which arg in error
  648.         );
  649.  
  650.         HRESULT InvokeAtPresentationTime(
  651.                     [out] IDeferredCommand** pCmd,
  652.                     [in] REFTIME time,            // at this presentation time
  653.                     [in] GUID* iid,                   // call this interface
  654.                     [in] long dispidMethod,         // ..and this method
  655.                     [in] short wFlags,              // method/property
  656.                     [in] long cArgs,                // count of args
  657.                     [in] VARIANT* pDispParams,      // actual args
  658.                     [in, out] VARIANT* pvarResult,  // return value
  659.                     [out] short* puArgErr           // which arg in error
  660.         );
  661.  
  662.     };
  663.  
  664.  
  665.  
  666.     // the filgraph object (CLSID_Filgraph)
  667.     [
  668.         uuid(e436ebb3-524f-11ce-9f53-0020af0ba770),
  669.         helpstring("Filtergraph type info")
  670.     ]
  671.     coclass FilgraphManager
  672.     {
  673.         [default] interface IMediaControl;
  674.         interface IMediaEvent;
  675.         interface IMediaPosition;
  676.         interface IBasicAudio;
  677.         interface IBasicVideo;
  678.         interface IVideoWindow;
  679.  
  680.     };
  681.  
  682.  
  683.     // represents a filter (you can't QI for IBaseFilter from this object)
  684.     [
  685.         uuid(56a868ba-0ad4-11ce-b03a-0020af0ba770),
  686.         helpstring("FilterInfo"),
  687.         odl,
  688.         oleautomation,
  689.         dual
  690.     ]
  691.     interface IFilterInfo : IDispatch
  692.     {
  693.         // find a pin given an id - returns an object supporting
  694.         // IPinInfo
  695.         HRESULT FindPin(
  696.                     [in] BSTR strPinID,
  697.                     [out] IDispatch** ppUnk);
  698.  
  699.         // filter name
  700.         [propget]
  701.         HRESULT Name(
  702.                     [out, retval] BSTR* strName);
  703.  
  704.         // Vendor info string
  705.         [propget]
  706.         HRESULT VendorInfo(
  707.                     [out, retval] BSTR* strVendorInfo);
  708.  
  709.         // returns the actual filter object (supports IBaseFilter)
  710.         [propget]
  711.         HRESULT Filter(
  712.                     [out, retval] IUnknown **ppUnk);
  713.  
  714.         // returns an IAMCollection object containing the PinInfo objects
  715.         // for this filter
  716.         [propget]
  717.         HRESULT Pins(
  718.                     [out, retval] IDispatch ** ppUnk);
  719.  
  720.         // returns -1 if true or 0 if false (OATRUE/FALSE)
  721.         [propget]
  722.         HRESULT IsFileSource(
  723.                     [out, retval] LONG * pbIsSource);
  724.  
  725.         [propget]
  726.         HRESULT Filename(
  727.                     [out, retval] BSTR* pstrFilename);
  728.  
  729.         [propput]
  730.         HRESULT Filename(
  731.                     [in] BSTR strFilename);
  732.     }
  733.  
  734.     [
  735.         uuid(56a868bb-0ad4-11ce-b03a-0020af0ba770),
  736.         helpstring("Registry Filter Info"),
  737.         odl,
  738.         oleautomation,
  739.         dual
  740.     ]
  741.     interface IRegFilterInfo : IDispatch
  742.     {
  743.         // get the name of this filter
  744.         [propget]
  745.         HRESULT Name(
  746.                     [out, retval] BSTR* strName);
  747.  
  748.  
  749.         // make an instance of this filter, add it to the graph and
  750.         // return an IFilterInfo for it.
  751.         HRESULT Filter(
  752.                     [out] IDispatch** ppUnk);
  753.     }
  754.  
  755.     // wrapper for a media type
  756.     [
  757.         uuid(56a868bc-0ad4-11ce-b03a-0020af0ba770),
  758.         helpstring("Media Type"),
  759.         odl,
  760.         oleautomation,
  761.         dual
  762.     ]
  763.     interface IMediaTypeInfo : IDispatch
  764.     {
  765.         // get the major type GUID as a string
  766.         [propget]
  767.         HRESULT Type(
  768.                     [out, retval] BSTR* strType);
  769.  
  770.         // get the subtype GUID as a string
  771.         [propget]
  772.         HRESULT Subtype(
  773.                     [out, retval] BSTR* strType);
  774.     }
  775.  
  776.     [
  777.         uuid(56a868bd-0ad4-11ce-b03a-0020af0ba770),
  778.         helpstring("Pin Info"),
  779.         odl,
  780.         oleautomation,
  781.         dual
  782.     ]
  783.     interface IPinInfo : IDispatch
  784.     {
  785.         // get the pin object (IUnknown for an object that
  786.         // supports IPin
  787.         [propget]
  788.         HRESULT Pin(
  789.                     [out, retval] IUnknown** ppUnk);
  790.  
  791.         // get the PinInfo object for the pin we are connected to
  792.         [propget]
  793.         HRESULT ConnectedTo(
  794.                     [out, retval] IDispatch** ppUnk);
  795.  
  796.         // get the media type on this connection - returns an
  797.         // object supporting IMediaTypeInfo
  798.         [propget]
  799.         HRESULT ConnectionMediaType(
  800.                     [out, retval] IDispatch** ppUnk);
  801.  
  802.  
  803.         // return the FilterInfo object for the filter this pin
  804.         // is part of
  805.         [propget]
  806.         HRESULT FilterInfo(
  807.                     [out, retval] IDispatch** ppUnk);
  808.  
  809.         // get the name of this pin
  810.         [propget]
  811.         HRESULT Name(
  812.                     [out, retval] BSTR* ppUnk);
  813.  
  814.         // pin direction
  815.         [propget]
  816.         HRESULT Direction(
  817.                     [out, retval] LONG *ppDirection);
  818.  
  819.         // PinID - can pass to IFilterInfo::FindPin
  820.         [propget]
  821.         HRESULT PinID(
  822.                     [out, retval] BSTR* strPinID);
  823.  
  824.         // collection of preferred media types (IAMCollection)
  825.         [propget]
  826.         HRESULT MediaTypes(
  827.                     [out, retval] IDispatch** ppUnk);
  828.  
  829.         // Connect to the following pin, using other transform
  830.         // filters as necessary. pPin can support either IPin or IPinInfo
  831.         HRESULT Connect(
  832.                     [in] IUnknown* pPin);
  833.  
  834.         // Connect directly to the following pin, not using any intermediate
  835.         // filters
  836.         HRESULT ConnectDirect(
  837.                     [in] IUnknown* pPin);
  838.  
  839.         // Connect directly to the following pin, using the specified
  840.         // media type only. pPin is an object that must support either
  841.         // IPin or IPinInfo, and pMediaType must support IMediaTypeInfo.
  842.         HRESULT ConnectWithType(
  843.                     [in] IUnknown * pPin,
  844.                     [in] IDispatch * pMediaType);
  845.  
  846.         // disconnect this pin and the corresponding connected pin from
  847.         // each other. (Calls IPin::Disconnect on both pins).
  848.         HRESULT Disconnect(void);
  849.  
  850.         // render this pin using any necessary transform and rendering filters
  851.         HRESULT Render(void);
  852.     }
  853.  
  854.     //--------------------------------------------------------------------
  855.     //
  856.     //  IAMStats - statistics
  857.     //
  858.     //  Note that the calls using an index are likely to be much faster
  859.     //--------------------------------------------------------------------
  860.  
  861.     [
  862.             uuid(bc9bcf80-dcd2-11d2-abf6-00a0c905f375),
  863.             helpstring("Statistics"),
  864.             odl,
  865.             oleautomation,
  866.             dual
  867.     ]
  868.     interface IAMStats : IDispatch {
  869.         //  Reset all stats
  870.         HRESULT Reset();
  871.  
  872.         //  Get number of stats collected
  873.         [propget]
  874.         HRESULT Count(
  875.                     [out, retval] LONG* plCount);
  876.  
  877.         //  Pull out a specific value by position
  878.         HRESULT GetValueByIndex([in] long lIndex,
  879.                                 [out] BSTR *szName,
  880.                                 [out] long *lCount,
  881.                                 [out] double *dLast,
  882.                                 [out] double *dAverage,
  883.                                 [out] double *dStdDev,
  884.                                 [out] double *dMin,
  885.                                 [out] double *dMax);
  886.  
  887.         //  Pull out a specific value by name
  888.         HRESULT GetValueByName([in] BSTR szName,
  889.                                [out] long *lIndex,
  890.                                [out] long *lCount,
  891.                                 [out] double *dLast,
  892.                                [out] double *dAverage,
  893.                                [out] double *dStdDev,
  894.                                [out] double *dMin,
  895.                                [out] double *dMax);
  896.  
  897.  
  898.         //  The calls below are for generators of statistics
  899.  
  900.         //  Return the index for a string - optinally create
  901.         HRESULT GetIndex([in] BSTR szName,
  902.                          [in] long lCreate,
  903.                          [out] long *plIndex);
  904.  
  905.         //  Add a new value
  906.         HRESULT AddValue([in] long lIndex,
  907.                          [in] double dValue);
  908.     }
  909. };
  910.